console.log('appStart', +new Date());
import React from "react";
import { render } from "react-dom";
import { HashRouter, Route, Redirect } from "react-router-dom";
import './theme.less';
import './style.css';
import App from './pages/app';
import { Provider } from 'react-redux';
import store from './stores/index';
import {AppContainer} from 'react-hot-loader';


// import greeter from 'ts/person.ts';
// import login from './login';

if (module.hot) {
    module.hot.accept('./pages/app', ()=> {
        console.log(module.hot.status());
        render(
            <AppContainer>
                <Provider store={store}>
                    <HashRouter>
                        <Route path="/" component={App} />
                    </HashRouter>
                </Provider>
            </AppContainer>
            ,
            document.getElementById('root'),
            ()=> {
                console.log('render', +new Date())
            }
        )
    });
}

if(____WEBPACK_DEBUG) {
    // login();
}

render(
    <AppContainer>
        <Provider store={store}>
            <HashRouter>
                <Route path="/" component={App} />
            </HashRouter>
        </Provider>
    </AppContainer>

    ,
    document.getElementById('root'),
    ()=> {
        console.log('render', +new Date())
    }
)

// if (navigator.serviceWorker) {
//     window.addEventListener('DOMContentLoaded',function() {
//       // 调用 serviceWorker.register 注册，参数 /sw.js 为脚本文件所在的 URL 路径
//         navigator.serviceWorker.register('sw.js');
//     });
// }

console.log('appEnd',+new Date());

// let user = {
//     firstName: 'Jane',
//     lastName: 'User'
// };

// document.getElementById('app').innerHTML = greeter(user);